package com.taotao.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * ${DESCRIPTION}
 *
 * @author muxiaoyu
 * @create 2017/06/27 14:07
 **/
@RequestMapping(value = "page")
@Controller
public class PageController {
    //使用@PathVariable注解时，@RequestMapping注解中value的值需要加大括号，例如：{pageName}
    @RequestMapping(value = "{pageName}")
    public ModelAndView toPage(@PathVariable("pageName") String pageName) {
        return new ModelAndView(pageName);
    }
}
